%% Author: kevin.jingqiu
%% Created: May 29, 2009
%% Description: TODO: Add description to p6
-module(p6).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([solve/0]).

%%
%% API Functions
%%
solve() -> p6(lists:seq(1, 100)).



%%
%% Local Functions
%%


p6(List) ->
	SumOfSquare = lists:sum(lists:map(fun(X)->X*X end, List)),
	SquareOfSum = math:pow(lists:sum(List), 2),
	SquareOfSum - SumOfSquare.
